package UnitTest.DatastructureTest.treeTest.binaryTreeTest.binaryTreeApplyTest;

import DataStructure.tree.binaryTree.binaryTreeApply.TreeLeftView;
import UnitTest.DatastructureTest.treeTest.BinaryTreeTestDemo;
import org.junit.Test;

import java.util.Arrays;

/**
 * @author liujun
 * @version 1.0
 * @date 2021/1/8
 * @author—Email liujunfirst@outlook.com
 * @blogURL https://blog.csdn.net/ljfirst
 * @description 树的左视图 测试案例
 */
public class TreeLeftViewTest extends BinaryTreeTestDemo {

    TreeLeftView leftView = new TreeLeftView();

    @Test
    public void testprint() {
        int[] target = leftView.print(gettreeArray04full());
        assert Arrays.equals(target, answer01);
        target = leftView.print(gettreeDemo03());
        assert Arrays.equals(target, answer02);
        target = leftView.print(getsubtreeDemo03());
        assert Arrays.equals(target, answer03);
        target = leftView.print(gettreeDemo05());
        assert Arrays.equals(target, answer04);
        target = leftView.print(gettreeArray06());
        assert Arrays.equals(target, answer06);
        target = leftView.print(null);
        assert Arrays.equals(target, answer05);
    }

    int[] answer01 = {1, 2};
    int[] answer02 = {1, 2, 4};
    int[] answer03 = {3, 6};
    int[] answer04 = {1, 2, 4, 9, 13, 14, 18, 19};
    int[] answer05 = new int[]{};
    int[] answer06 = {1, 2, 4, 8};
}
